<?php
@include('include/common.inc.php');	
$cate_id = $_GET['cate_id'];
if($cate_id==18)
{
	$cate_name = '房產新聞';
}else if($cate_id==19){
	$cate_name = '居家生活';
}
$query = "select * from $TBL_NEWS0 where cate_id=$cate_id order by id desc";
$cur_page = (int)$_GET["p"];   //获取当前页
$url_param = preg_replace("/(p=[0-9]+)&/", "", $_SERVER['QUERY_STRING']);
$pages = new Pager($query, $cur_page, 18, $url_param);
$page_string = $pages -> getPageString();   
$result = $pages -> getRsPerPage();	
while($rows = $db->fetch_array($result))
{
	$advsss[] = $rows;
}	
@include('number.php');//验证码
$smarty->assign("advsss",$advsss);
$smarty->assign("cate_name",$cate_name);
$smarty->assign("page_string",$page_string);
$smarty->display('news0.html');
?>